import request from '@/utils/request'
const module = '/admin/product/spec'

export const getAllSpecs = () => {
    return request({
      url: `${module}/list`,
      method: 'get'
    })
  }

  export const getSpecs = (pageNum,pageSize) => {
    return request({
      url: `${module}/list/${pageNum}/${pageSize}`,
      method: 'get'   
    })
  }

  export const saveSpecs = spec => {
    return request({
      url: `${module}/save`,
      method: 'post',
      data: spec
    })
  }
  export const deleteSpecsById = id => {
    return request({
      url: `${module}/deleteById/${id}`,
      method: 'delete',
    })
  }
  export const updateSpecs = (spec) => {
    return request({
      url: `${module}/update`,
      method: 'put',
      data:spec
    })
  }
  export const getSpecsById = id => {
    return request({
      url: `${module}/getById/${id}`,
      method: 'get',
    })
  }
